/*
 * @(#)MaintStaffRecordForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.staff.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;
import com.dcivision.staff.bean.StaffRecord;

/**
  MaintStaffRecordForm.java

  This class is the for web form purpose.

  @author      Wong Yam Lee
  @company     DCIVision Limited
  @creation date   05/08/2003
  @version     $Revision: 1.6 $
*/

public class MaintStaffRecordForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.6 $";

  private String staffCode = null;
  private String iDNo = null;
  private String passportNo = null;
  private String issueCountryID = null;
  private String salutationID = null;
  private String firstNameEng = null;
  private String lastNameEng = null;
  private String firstName = null;
  private String lastName = null;
  private String fullName = null;
  private String gender = null;
  private String birthDate = null;
  private String title = null;
  private String areaCode = null;
  private String phoneNo = null;
  private String mobileNo = null;
  private String faxNo = null;
  private String pagerNo = null;
  private String extension = null;
  private String email = null;
  private String rentalAddress = null;
  private String mailAddress = null;
  private String reportToStaffRecordID = null;
  private String level1ID = null;
  private String level2ID = null;
  private String level3ID = null;
  private String level4ID = null;
  private String level5ID = null;
  private String level6ID = null;
  private String level7ID = null;
  private String level8ID = null;
  private String level9ID = null;
  private String level10ID = null;
  private String status = null;
  private String spokenLanguage = null;
  private String expertise = null;
  private String alternativeContactStaffRecordID = null;
  private String remarks = null;

  private String levelNo = "";
  private String parentID = "0";   
  private String deleteUserRecord = "false";
  
  public MaintStaffRecordForm() {
    super();
  }

  public String getStaffCode() {
    return(this.staffCode);
  }

  public void setStaffCode(String staffCode) {
    this.staffCode = staffCode;
  }

  public String getIDNo() {
    return(this.iDNo);
  }

  public void setIDNo(String iDNo) {
    this.iDNo = iDNo;
  }

  public String getPassportNo() {
    return(this.passportNo);
  }

  public void setPassportNo(String passportNo) {
    this.passportNo = passportNo;
  }

  public String getIssueCountryID() {
    return(this.issueCountryID);
  }

  public void setIssueCountryID(String issueCountryID) {
    this.issueCountryID = issueCountryID;
  }

  public String getSalutationID() {
    return(this.salutationID);
  }

  public void setSalutationID(String salutationID) {
    this.salutationID = salutationID;
  }

  public String getFirstNameEng() {
    return(this.firstNameEng);
  }

  public void setFirstNameEng(String firstNameEng) {
    this.firstNameEng = firstNameEng;
  }

  public String getLastNameEng() {
    return(this.lastNameEng);
  }

  public void setLastNameEng(String lastNameEng) {
    this.lastNameEng = lastNameEng;
  }

  public String getFirstName() {
    return(this.firstName);
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public String getLastName() {
    return(this.lastName);
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public String getFullName() {
    return(this.fullName);
  }

  public void setFullName(String fullName) {
    this.fullName = fullName;
  }

  public String getGender() {
    return(this.gender);
  }

  public void setGender(String gender) {
    this.gender = gender;
  }

  public String getBirthDate() {
    return(this.birthDate);
  }

  public void setBirthDate(String birthDate) {
    this.birthDate = birthDate;
  }

  public String getTitle() {
    return(this.title);
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getAreaCode() {
    return(this.areaCode);
  }

  public void setAreaCode(String areaCode) {
    this.areaCode = areaCode;
  }

  public String getPhoneNo() {
    return(this.phoneNo);
  }

  public void setPhoneNo(String phoneNo) {
    this.phoneNo = phoneNo;
  }

  public String getMobileNo() {
    return(this.mobileNo);
  }

  public void setMobileNo(String mobileNo) {
    this.mobileNo = mobileNo;
  }

  public String getFaxNo() {
    return(this.faxNo);
  }

  public void setFaxNo(String faxNo) {
    this.faxNo = faxNo;
  }

  public String getPagerNo() {
    return(this.pagerNo);
  }

  public void setPagerNo(String pagerNo) {
    this.pagerNo = pagerNo;
  }

  public String getExtension() {
    return(this.extension);
  }

  public void setExtension(String extension) {
    this.extension = extension;
  }

  public String getEmail() {
    return(this.email);
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getRentalAddress() {
    return(this.rentalAddress);
  }

  public void setRentalAddress(String rentalAddress) {
    this.rentalAddress = rentalAddress;
  }

  public String getMailAddress() {
    return(this.mailAddress);
  }

  public void setMailAddress(String mailAddress) {
    this.mailAddress = mailAddress;
  }

  public String getReportToStaffRecordID() {
    return(this.reportToStaffRecordID);
  }

  public void setReportToStaffRecordID(String reportToStaffRecordID) {
    this.reportToStaffRecordID = reportToStaffRecordID;
  }

  public String getLevel1ID() {
    return(this.level1ID);
  }

  public void setLevel1ID(String level1ID) {
    this.level1ID = level1ID;
  }

  public String getLevel2ID() {
    return(this.level2ID);
  }

  public void setLevel2ID(String level2ID) {
    this.level2ID = level2ID;
  }

  public String getLevel3ID() {
    return(this.level3ID);
  }

  public void setLevel3ID(String level3ID) {
    this.level3ID = level3ID;
  }

  public String getLevel4ID() {
    return(this.level4ID);
  }

  public void setLevel4ID(String level4ID) {
    this.level4ID = level4ID;
  }

  public String getLevel5ID() {
    return(this.level5ID);
  }

  public void setLevel5ID(String level5ID) {
    this.level5ID = level5ID;
  }

  public String getLevel6ID() {
    return(this.level6ID);
  }

  public void setLevel6ID(String level6ID) {
    this.level6ID = level6ID;
  }

  public String getLevel7ID() {
    return (this.level7ID);
  }

  public void setLevel7ID(String level7ID) {
    this.level7ID = level7ID;
  }

  public String getLevel8ID() {
    return (this.level8ID);
  }

  public void setLevel8ID(String level8ID) {
    this.level8ID = level8ID;
  }

  public String getLevel9ID() {
    return (this.level9ID);
  }

  public void setLevel9ID(String level9ID) {
    this.level9ID = level9ID;
  }

  public String getLevel10ID() {
    return (this.level10ID);
  }

  public void setLevel10ID(String level10ID) {
    this.level10ID = level10ID;
  }

  public String getStatus() {
    return(this.status);
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public String getSpokenLanguage() {
    return(this.spokenLanguage);
  }

  public void setSpokenLanguage(String spokenLanguage) {
    this.spokenLanguage = spokenLanguage;
  }

  public String getExpertise() {
    return(this.expertise);
  }

  public void setExpertise(String expertise) {
    this.expertise = expertise;
  }

  public String getAlternativeContactStaffRecordID() {
    return(this.alternativeContactStaffRecordID);
  }

  public void setAlternativeContactStaffRecordID(String alternativeContactStaffRecordID) {
    this.alternativeContactStaffRecordID = alternativeContactStaffRecordID;
  }

  public String getRemarks() {
    return(this.remarks);
  }

  public void setRemarks(String remarks) {
    this.remarks = remarks;
  }
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setStaffCode(null);
    this.setIDNo(null);
    this.setPassportNo(null);
    this.setIssueCountryID(null);
    this.setSalutationID(null);
    this.setFirstNameEng(null);
    this.setLastNameEng(null);
    this.setFirstName(null);
    this.setLastName(null);
    this.setFullName(null);
    this.setGender(null);
    this.setBirthDate(null);
    this.setTitle(null);
    this.setAreaCode(null);
    this.setPhoneNo(null);
    this.setMobileNo(null);
    this.setFaxNo(null);
    this.setPagerNo(null);
    this.setExtension(null);
    this.setEmail(null);
    this.setRentalAddress(null);
    this.setMailAddress(null);
    this.setReportToStaffRecordID(null);
    this.setLevel1ID(null);
    this.setLevel2ID(null);
    this.setLevel3ID(null);
    this.setLevel4ID(null);
    this.setLevel5ID(null);
    this.setLevel6ID(null);
    this.setLevel7ID(null);
    this.setLevel8ID(null);
    this.setLevel9ID(null);
    this.setLevel10ID(null);
    this.setStatus(null);
    this.setSpokenLanguage(null);
    this.setExpertise(null);
    this.setAlternativeContactStaffRecordID(null);
    this.setRemarks(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    StaffRecord tmpStaffRecord = new StaffRecord();
    tmpStaffRecord.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpStaffRecord.setStaffCode(this.getStaffCode());
    tmpStaffRecord.setIDNo(this.getIDNo());
    tmpStaffRecord.setPassportNo(this.getPassportNo());
    tmpStaffRecord.setIssueCountryID(TextUtility.parseIntegerObj(this.getIssueCountryID()));
    tmpStaffRecord.setSalutationID(TextUtility.parseIntegerObj(this.getSalutationID()));
    tmpStaffRecord.setFirstNameEng(this.getFirstNameEng());
    tmpStaffRecord.setLastNameEng(this.getLastNameEng());
    tmpStaffRecord.setFirstName(this.getFirstName());
    tmpStaffRecord.setLastName(this.getLastName());
    tmpStaffRecord.setFullName(this.getFullName());
    tmpStaffRecord.setGender(this.getGender());
    tmpStaffRecord.setBirthDate(parseTimestamp(this.getBirthDate()));
    tmpStaffRecord.setTitle(this.getTitle());
    tmpStaffRecord.setAreaCode(this.getAreaCode());
    tmpStaffRecord.setPhoneNo(this.getPhoneNo());
    tmpStaffRecord.setMobileNo(this.getMobileNo());
    tmpStaffRecord.setFaxNo(this.getFaxNo());
    tmpStaffRecord.setPagerNo(this.getPagerNo());
    tmpStaffRecord.setExtension(this.getExtension());
    tmpStaffRecord.setEmail(this.getEmail());
    tmpStaffRecord.setRentalAddress(this.getRentalAddress());
    tmpStaffRecord.setMailAddress(this.getMailAddress());
    tmpStaffRecord.setReportToStaffRecordID(TextUtility.parseIntegerObj(this.getReportToStaffRecordID()));
    tmpStaffRecord.setLevel1ID(TextUtility.parseIntegerObj(this.getLevel1ID()));
    tmpStaffRecord.setLevel2ID(TextUtility.parseIntegerObj(this.getLevel2ID()));
    tmpStaffRecord.setLevel3ID(TextUtility.parseIntegerObj(this.getLevel3ID()));
    tmpStaffRecord.setLevel4ID(TextUtility.parseIntegerObj(this.getLevel4ID()));
    tmpStaffRecord.setLevel5ID(TextUtility.parseIntegerObj(this.getLevel5ID()));
    tmpStaffRecord.setLevel6ID(TextUtility.parseIntegerObj(this.getLevel6ID()));
    tmpStaffRecord.setLevel7ID(TextUtility.parseIntegerObj(this.getLevel7ID()));
    tmpStaffRecord.setLevel8ID(TextUtility.parseIntegerObj(this.getLevel8ID()));
    tmpStaffRecord.setLevel9ID(TextUtility.parseIntegerObj(this.getLevel9ID()));
    tmpStaffRecord.setLevel10ID(TextUtility.parseIntegerObj(this.getLevel10ID()));
    tmpStaffRecord.setStatus(this.getStatus());
    tmpStaffRecord.setSpokenLanguage(this.getSpokenLanguage());
    tmpStaffRecord.setExpertise(this.getExpertise());
    tmpStaffRecord.setAlternativeContactStaffRecordID(TextUtility.parseIntegerObj(this.getAlternativeContactStaffRecordID()));
    tmpStaffRecord.setRemarks(this.getRemarks());
    tmpStaffRecord.setRecordStatus(this.getRecordStatus());
    tmpStaffRecord.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpStaffRecord.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpStaffRecord.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpStaffRecord.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpStaffRecord.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpStaffRecord;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    StaffRecord tmpStaffRecord = (StaffRecord)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpStaffRecord.getID()));
    this.setStaffCode(tmpStaffRecord.getStaffCode());
    this.setIDNo(tmpStaffRecord.getIDNo());
    this.setPassportNo(tmpStaffRecord.getPassportNo());
    this.setIssueCountryID(TextUtility.formatIntegerObj(tmpStaffRecord.getIssueCountryID()));
    this.setSalutationID(TextUtility.formatIntegerObj(tmpStaffRecord.getSalutationID()));
    this.setFirstNameEng(tmpStaffRecord.getFirstNameEng());
    this.setLastNameEng(tmpStaffRecord.getLastNameEng());
    this.setFirstName(tmpStaffRecord.getFirstName());
    this.setLastName(tmpStaffRecord.getLastName());
    this.setFullName(tmpStaffRecord.getFullName());
    this.setGender(tmpStaffRecord.getGender());
    this.setBirthDate(formatTimestamp(tmpStaffRecord.getBirthDate()));
    this.setTitle(tmpStaffRecord.getTitle());
    this.setAreaCode(tmpStaffRecord.getAreaCode());
    this.setPhoneNo(tmpStaffRecord.getPhoneNo());
    this.setMobileNo(tmpStaffRecord.getMobileNo());
    this.setFaxNo(tmpStaffRecord.getFaxNo());
    this.setPagerNo(tmpStaffRecord.getPagerNo());
    this.setExtension(tmpStaffRecord.getExtension());
    this.setEmail(tmpStaffRecord.getEmail());
    this.setRentalAddress(tmpStaffRecord.getRentalAddress());
    this.setMailAddress(tmpStaffRecord.getMailAddress());
    this.setReportToStaffRecordID(TextUtility.formatIntegerObj(tmpStaffRecord.getReportToStaffRecordID()));
    this.setLevel1ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel1ID()));
    this.setLevel2ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel2ID()));
    this.setLevel3ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel3ID()));
    this.setLevel4ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel4ID()));
    this.setLevel5ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel5ID()));
    this.setLevel6ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel6ID()));
    this.setLevel7ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel7ID()));
    this.setLevel8ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel8ID()));
    this.setLevel9ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel9ID()));
    this.setLevel10ID(TextUtility.formatIntegerObj(tmpStaffRecord.getLevel10ID()));
    this.setStatus(tmpStaffRecord.getStatus());
    this.setSpokenLanguage(tmpStaffRecord.getSpokenLanguage());
    this.setExpertise(tmpStaffRecord.getExpertise());
    this.setAlternativeContactStaffRecordID(TextUtility.formatIntegerObj(tmpStaffRecord.getAlternativeContactStaffRecordID()));
    this.setRemarks(tmpStaffRecord.getRemarks());
    this.setRecordStatus(tmpStaffRecord.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpStaffRecord.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpStaffRecord.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpStaffRecord.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpStaffRecord.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpStaffRecord.getUpdateDate()));
  }

  public String getParentID() {
    return(this.parentID);
  }
  
  public void setParentID(String parentID) {
    this.parentID = parentID;
  }
  
  public String getlevelNo() {
    return(this.levelNo);
  }
  
  public void setlevelNo(String levelNo) {
    this.levelNo = levelNo;
  }
    
  public String getDeleteUserRecord() {
    return this.deleteUserRecord;
  }
  
  public void setDeleteUserRecord(String deleteUserRecord) {
    this.deleteUserRecord = deleteUserRecord;
  }

}
